import random
def generate_random_array(length, min_val, max_val):
    return [random.randint(min_val, max_val) for _ in range(length)]